package com.holdtime.jtt809dataservice.common.domain;

import java.util.concurrent.ConcurrentHashMap;

public class LinkStatusManager {
    ConcurrentHashMap<Long, Object> parentPlatformMainLinkStatus = new ConcurrentHashMap<>();
    ConcurrentHashMap<Long, Object> parentPlatformSubLinkStatus = new ConcurrentHashMap<>();
    private static LinkStatusManager linkStatusManager = new LinkStatusManager();

    private LinkStatusManager() {
    }

    public static LinkStatusManager getCurrent() {
        return linkStatusManager;
    }

    public Object getMainLinkStatus(Long id) {
        return parentPlatformMainLinkStatus.get(id);
    }

    public Object getSubLinkStatus(Long id) {
        return parentPlatformSubLinkStatus.get(id);
    }

    public void putMainLinkStatus(Long id, Object status) {
        parentPlatformMainLinkStatus.put(id, status);
    }

    public void putSubLinkStatus(Long id, Object status) {
        parentPlatformSubLinkStatus.put(id, status);
    }

    public void removeMainLinkStatus(Long id) {
        parentPlatformMainLinkStatus.remove(id);
    }

    public void removeSubLinkStatus(Long id) {
        parentPlatformSubLinkStatus.remove(id);
    }
}
